#!/bin/ash

set -e

bin=`dirname "$0"`
bin=`cd "$bin"; pwd`

. "$bin"/config.sh

source "$bin"/config.sh

pid=$(findPID)

if [ -z "$pid" ]; then
    echo "进程不存在"
    exit  1
fi

echo "pid ${pid} 进程已经关闭"

#signal ${pid} TERM
kill ${pid}

exit  0

#for i in {1..7}; do
#   sleep 1
#   pid=$(findPID)
#
#   if [ -z "$pid" ]; then
#       echo "进程已经关闭"
#       exit  0
#   fi
#done
#
#echo "进程还未停止"
#exit  1

